<?php

namespace Part01_SimpleFactoryMode\Code3;
/**
 * @desc: 运算类
 * @date: 2021/9/9
 */
class Operation
{
    public static function getResult($numA, $numB, $operate)
    {
        $result = 0;
        switch ($operate) {
            case '+':
                $result = $numA + $numB;
                break;
            case '-':
                $result = $numA - $numB;
                break;
            case '*':
                $result = $numA * $numB;
                break;
            case '/':
                $result = $numA / $numB;
                break;
        }
        return $result;
    }
}

